package com.baizhi.mall.controller;


import com.baizhi.mall.entity.mysql.BzRoleDO;
import com.baizhi.mall.service.IBzRoleService;
import com.baizhi.mall.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhw
 * @since 2021-05-17
 */
@RestController
public class BzRoleController {
    @Autowired
    private IBzRoleService rs;
    @GetMapping("/roles")
    @PreAuthorize("hasAnyAuthority('sys:user:list,sys:user:info')")
    public ResultEntity<List<BzRoleDO>> selectAll(){
        List<BzRoleDO> list=rs.selectAll();
        return ResultEntity.ok(list);
    }
}

